What is Duet?
Duet is an SSH-first pair programming tool that lets you collaborate in real-time through a shared live terminal. Built with Go and Charm (Bubbletea/Wish), Duet combines the simplicity of SSH with powerful features like AI assistance and sandboxed command execution.Quickstart
Connect and start your first pairing session in under a minute
AI assistant
Get help from an AI agent powered by Cloudflare Workers
Shared terminal
Real-time collaborative terminal with nvim and nodejs
Sandbox execution
Run commands safely in an isolated Cloudflare sandbox
Key features
Shared terminal
All participants in a session share the same live terminal environment. Every keystroke, command, and output is synchronized in real-time across all connected users.- nvim - For collaborative code editing
- nodejs - For running JavaScript/TypeScript projects
- Full shell environment for seamless development
AI features
Duet includes an AI assistant powered by Cloudflare’s LLM (Llama) with persistent context per room using Durable Objects.Press
ctrl+g in any session to ask the AI a question. The AI has access to your entire conversation history within the room.- Code explanations and debugging
- Architecture suggestions
- Command recommendations
- Learning and teaching programming concepts
Sandbox features
Run commands in an isolated Cloudflare sandbox without affecting the main terminal environment.- Testing potentially destructive commands
- Running isolated builds
- File operations without side effects
- Safe experimentation
Use cases
Teaching
Walk students through code in real-time with shared context
Interviews
Conduct technical interviews with live coding sessions
Pair programming
Collaborate on code with teammates remotely
How it works
Duet uses a simple client-server architecture:- SSH connection - Users connect via standard SSH client
- Room-based sessions - Create or join rooms with unique IDs
- Terminal synchronization - All input/output is broadcast to room participants
- AI integration - Optional AI assistance via Cloudflare Workers
Architecture
Duet is built with modern Go and leverages the Charm ecosystem:- Server: Go with Wish SSH server
- UI: Bubbletea TUI framework
- Styling: Lipgloss for terminal styling
- AI/Sandbox: Cloudflare Workers with Durable Objects and Sandboxes
Ready to get started?
Quickstart guide
Connect to Duet and create your first pairing session